home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGNG_C / TURBOCU1.LZH / TCOMM.ARC / TL.C < prev   
Text File  |  1987-06-08  |  655b  |  46 lines

  1. #include "stddef.h"
  2. #include "dos.h"
  3. #include "conio.h"
  4. #include "litecomm.h"
  5.  
  6. main()
  7. {
  8.     int    ch;
  9.     COMM     *ccb;
  10.  
  11.     if (comm_opn(3,B2400,NPARITY,BIT8,STOP1,512,64) == ERR)
  12.     {
  13.         puts("Open Failure\n");
  14.         exit(1);
  15.     }
  16.     lc_setmdm(3,(DTR | RTS));
  17.  
  18.     while(TRUE)
  19.     {
  20.         if(kbhit())
  21.         {
  22.             ch = getch();
  23.             switch (ch)
  24.             {
  25.                 case 0x1b: break;
  26.                 default:   if(lc_put(3,ch) == ERR)
  27.                               puts("Put Failed\n");
  28.             }
  29.             if (ch == 0x1b)
  30.                 break;
  31.         }
  32.         if((ch = lc_get(3)) != ERR)
  33.             if (ch == '\r')
  34.             {
  35.                 putch(ch);
  36.                 putch(0x0a);
  37.             }
  38.             else
  39.                 if (ch != 0x0a)
  40.                     putch(ch);
  41.     }    
  42.     comm_close(3);
  43.     exit(0);
  44. }
  45.  
  46.